package com.andy.mvp.poetry.presenter;

import com.andy.app_core.net.databus.RegisterRxBus;
import com.andy.mvp.poetry.bean.Proetry;
import com.andy.mvp.poetry.module.IProetryModule;
import com.andy.mvp.poetry.module.ProetryModuleImpl;
import com.andy.mvp.poetry.view.IProetryView;

import java.lang.ref.WeakReference;
import java.util.ArrayList;

/**
 * @version V1.0
 * @描述:
 * @Company:
 * @auth: Created by AN .
 * @time: 2020/3/27 18:51
 * @des
 */
public class ProetryPresenter<T extends IProetryView> {
    WeakReference<T> mView;

    IProetryModule proetryModule=new ProetryModuleImpl();

    public ProetryPresenter(T mView) {
        this.mView = new WeakReference<T>(mView);
        proetryModule .loadProetry(0);
    }

    public  void loadMore(int page){
        proetryModule .loadProetry(page);
    }
    @RegisterRxBus
    public void showProetry(ArrayList<Proetry> proetryList){
        mView.get().showProetrys(proetryList);
    }


}
